<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>解构赋值</title>
</head>
<body>


<script type="text/javascript">

    let [x,y,z] =['1','2','3'];
    console.log(x + ',' + y + ',' + 'z');

    (function (){

        let [x,y,z]=[[1,2,3],[4,5,6],[7,8,9]];
        console.log(x,y,z);

    })();
    
    {

        let a = 10;
        let b = 100;

        [a,b] = [b,a];

        console.log(a,b);

    }

    {
        var a = 10;
        var b = 100;
        b = b - a;
        a = a + b;
        b = a - b;
        console.log(a,b);
    }

</script>

</body>
</html>